package com.gr.controller;

import com.gr.entity.User;
import com.gr.service.UserService;
import com.gr.service.impl.UserServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
//@RequestMapping("/user")
public class UserController {
    UserService us=new UserServiceImpl();
    @RequestMapping("/login")
    public String login(String username,String password){
        User user=us.login(username, password);
        System.out.println(user);
        //之前没有加登录判断,登录判断加了以后卡登录
        if (user!=null){
            return "/tea/select.do";//此处写成selectAll
        }else {
            return "/login.jsp";
        }

    }
}
